package org.eminem.spring.cloud.finchley.config;

import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

/**
 * 由于spring-boot-starter-security默认开启了csrf校验，对于Client端这类非界面应用来说不合适，但是又没有配置文件的方式
 * 可以禁用，需要自己通过java的配置文件禁用下。
 * Created by zhoucheng on 2018-10-26
 */
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        super.configure(http);
        http.csrf().disable();
    }
}
